<?php

$http = new Swoole\Http\Server('127.0.0.1', 9991, SWOOLE_BASE);

$http->on('start', function ($server) {

    echo "Swoole http server 已启动, 可访问 http://127.0.0.1:9501\n";
});

$http->on('request', function ($request, $response) {

    $response->header('Content-Type', 'text/plain');

    $response->end('你好,这是我的第一个swoole http web服务器!');

});
$http->start();